package com.stadium.bean;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "users")
public class User implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;
	// 用户名
	private String username;
	// 账号
	private String account;
	// 密码
	private String password;
	// 状态
	// 0:表示未删除 1:表示删除
	private Integer status;
	// 0:表示普通用户
	// 1:表示赛事管理员(eventManager)
	// 2:表示器材管理员(equipManager)
	// 3:表示场地管理员(siteManager)
	// 4:表示超级管理员(admin)
	private Integer role;

	public User() {
		super();
	}

	public User(Integer id, String username, String account, String password,
			Integer status, Integer role) {
		super();
		this.id = id;
		this.username = username;
		this.account = account;
		this.password = password;
		this.status = status;
		this.role = role;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(length = 50, nullable = false)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(length = 30, nullable = false, unique = true)
	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(length = 255, nullable = false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(length = 2, nullable = false)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(length = 4)
	public Integer getRole() {
		return role;
	}

	public void setRole(Integer role) {
		this.role = role;
	}

}
